import { getMineInfor } from '../../request/api.js';
export default{
	namespaced: true,
	state:{
		haveLogin:false,
		driverType:1,
		myInfor:"",
		imgUrl:"http://192.168.1.29:8080",
		driverStatus:0
	},
	getters:{
		
	},
	mutations:{
		CHANGE_DRIVER_STATUS(state,e){
			state.driverStatus=e;
		},
		CHANGE_DRIVER_TYPE(state,e){
			state.driverType=e;
		},
		CHANGE_LOGIN_STATUS(state,e){
			state.haveLogin=e;
		},
		CHANGE_MY_INFOR(state,e){
			state.myInfor=e;
		}
	},
	actions:{
		async getMineInfor(context){
			let res=await getMineInfor();
			console.log(res);
			if(res.code==1){
				context.commit("CHANGE_MY_INFOR",res.data.userinfo);
			}
		}
	}
}